package steps
{
	import jnBase.BaseZhishi;
	import jnBase.InsPages;
	import jnBase.PSteps;
	
	import laya.utils.Handler;
	import laya.utils.Tween;
	
	import ui.steps.step2_4042hengxianUI;

	public class Step02_4042HengXian extends step2_4042hengxianUI implements InsPages
	{
		public var _scriptPage:PSteps;
		public var _scriptZhishi:BaseZhishi;
		private var zhishiStr:String=""
		public function Step02_4042HengXian()
		{
			super();
			size(1920,1080);
			this.name="2.40~42℃横线之间";
			_scriptPage=this.addComponent(PSteps);
			_scriptZhishi=this.addComponent(BaseZhishi);
		}
		public function changeSonStep():void
		{
			_scriptZhishi.showTips("用红钢笔在40～42℃横线之间相应的时间格内纵向填写病入");
			Laya.timer.once(4000,this,function():void{
				_scriptZhishi.showTips("填写要求为：入院、转入、分娩、出院、死亡等项目后写“于”或划一竖线，其下用中文书写时间，例如“入院于十时二十分”");
				_scriptZhishi.xiankuangClick(711,405,38,217,function():void{
					_scriptZhishi.clearLoop();
					_scriptZhishi.hideAllZhishi();
					Tween.to(ruyuan,{alpha:1},400,null,Handler.create(this,function():void{
						_scriptZhishi.showTips("转入时间由转入病区填写，如“转入于二十时三十分”");
						_scriptZhishi.xiankuangClick(825,405,38,217,function():void{
							_scriptZhishi.clearLoop();
							_scriptZhishi.hideAllZhishi();
							Tween.to(zhuanyuan,{alpha:1},400,null,Handler.create(this,function():void{
								_scriptZhishi.showTips("手术不写具体手术名称和具体手术时间");
								_scriptZhishi.xiankuangClick(900,405,38,217,function():void{
									_scriptZhishi.clearLoop();
									_scriptZhishi.hideAllZhishi();
									Tween.to(shoushu,{alpha:1},400,null,Handler.create(this,function():void{
										_scriptZhishi.showTips("除了手术不写具体时间外，其余均采用24小时制，精确到分钟");
										Laya.timer.once(4000,this,function():void{
											_scriptPage.addPage(2);
										});
									}));
								});
							}));
						});
					}));
				});
			});
		}
		/**
		 *切换二级菜单时自动调用
		 * 显示新的二级页面时会自动调用此方法 
		 * 
		 */		
		public function reset():void
		{
			_scriptZhishi.hideAll();
			removeAllListener();
			zhishiStr="";
			
		}
		/**
		 *移除所有监听 
		 * 
		 */		
		public function removeAllListener():void
		{
			_scriptZhishi.removeAllHandler();	
		}
		override public function onEnable():void{
			reset();
		}
		/**
		 *关闭时自动调用 
		 * @param type
		 * 
		 */		
		override public function close(type:String=null):void
		{
			// TODO Auto Generated method stub
			_scriptPage.enabled=false;
			_scriptZhishi.enabled=false;
			removeAllListener();
			Tween.to(this,{x:-GameConfig.width,alpha:0},300,null,Handler.create(this,closeSuper,[type]));
		}
		private function closeSuper(type:String=null):void{
			super.close(type);
		}
		/**
		 *每秒执行一次 
		 * 
		 */		
		public function lineLoop():void
		{
			// TODO Auto Generated method stub
			if(zhishiStr==""){
				_scriptZhishi.zhishiRect.alpha=1;
				Tween.to(_scriptZhishi.zhishiRect,{alpha:0.1},600);
			}
			else if(zhishiStr=="xi"){
				_scriptZhishi.mdown.visible=true;
				_scriptZhishi.mdown.pos(958,688);
				_scriptZhishi.mdown.rotation=-155;
				Tween.to(_scriptZhishi.mdown,{x:990,y:596},600);
			}
		}
		/**
		 *被移除时自动调用  
		 * 因为设置了自动销毁，所以关闭后后会执行销毁 ，因为关闭时加了一个动画，所以要300毫秒后才执行销毁
		 * 
		 */		
		override public function onDestroy():void{
			trace(this.name+"销毁");
		}
	}
}